﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<QuestionInputModels>" %>

<%@ Import Namespace="SDT.Lib.Paging" %>
<%@ Import Namespace="SDT.Site.ViewModels" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Diễn đàn, hỏi đáp về bất động sản, nhà đất, luật nhà đất
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <div class="tinrao_col_l">
        <div class="bor_cor">
            <% Html.RenderAction("Lasted", "QuestionCategory", new
               {
                   title = "Chuyên mục hỏi đáp"
               }); %>
        </div>
        <div class="clear">
        </div>
    </div>
    <div class="tinrao_col_cen">
        <div class="content">
            <div id="product-tabs">
                <div class="ui-tabs-panel ui-widget-content ui-corner-bottom" id="product-tabs-1"
                    style="overflow: hidden;">
                    <% if (Model.Question != null)
           { %>
                    <div style="display: block; overflow: hidden;">
                        <div class="intro">
                            <h3>
                                <a title="<%= Model.Question.Title %>" href="#"><span class="name">
                                    <%= Model.Question.Title%></span> </a>
                            </h3>
                            <div class="content">
                                <span class="author">Người gửi: <strong>
                                    <%= Model.Question.AddBy.HasValue ? Model.Question.aspnet_User.UserName : Model.Question.SendBy%></strong>
                                    | Thời gian gửi:
                                    <%= Model.Question.AddDate%></span> <span class="mores">Trong: <a href="#" style="color: #1C7B9B;">
                                        <%= Model.Question.CatID.HasValue ? Model.Question.QuestionCategory.Name : "Khác"%></a>
                                    | Trả lời: (<a title="<%= Model.Question.Title %>" href="#"
                                        class="answer" style="color: #1C7B9B;"><%= Model.Question.nPubAnswers%></a>) | Lần
                                        xem: (<label style="color: black;"><%= Model.Question.nViews%></label>)
                                
                                
                                
                                
                                </span>
                            </div>
                        </div>
                    </div>
                    <div class="listdetail">
                        <h4>
                            <label>
                                Chi tiết câu hỏi
                            </label>
                        </h4>
                        <span id="listcontent">
                            <p>
                                <%= Model.Question.QuestionContent%></p>
                        </span>
                    </div>
                    <%} %>
                </div>
                <div id="reply">
                    <h3 style="color: #1C7D9D; text-align: center; margin: 20px 0px; cursor: pointer;">
                        <a href="#reply">Trả lời câu hỏi này</a></h3>
                </div>
                <div style="margin-left: 4px;" id="divReply">
                    <form name="reply" action="/Question/Answer" method="post">
                    <div id="_PersonalInfor" style="display: block;">
                        <div style="width: 50%; float: left; text-align: left;">
                            <h4 style="margin: 8px 0px;">
                                Tên liên hệ</h4>
                            <%= Html.TextBoxFor(m => m.Answer.AnswerName, new { @class = "required", @style = "width: 95%;" })%>
                        </div>
                        <div style="width: 50%; float: right; text-align: left;">
                            <h4 style="margin: 8px 0px;">
                                Email&nbsp;(<span style="color: Red;">*</span>)</h4>
                            <%= Html.TextBoxFor(m => m.Answer.AnswerEmail, new { @class = "required email", @style = "width: 95%;" })%>
                        </div>
                    </div>
                    <div style="clear: both; padding-top: 10px;">
                        <%= Html.TextAreaFor(m=>m.Answer.Answers, new { @class = "required", @rows = "18", @cols = "69" })%>
                    </div>

                    <script src="../../tiny_mce/tiny_mce.js" type="text/javascript"></script>
                    <script language="javascript" type="text/javascript">
                        $(document).ready(function() {
                            displayReplyForm();
                        });

                        function displayReplyForm() {
                            $("#divReply").show();
                            $(document).attr("location", "#reply");
                            $("#divReply").focus();
                        }
                        
                        tinyMCE.init({
                            mode: "exact",
                            plugins: "emotions",
                            theme: "advanced",
                            elements: "Answer_Answers",
                            theme_advanced_buttons1: "mybutton,bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,emotions,undo,redo,link,unlink,image",
                            theme_advanced_buttons2: "",
                            theme_advanced_buttons3: "",
                            theme_advanced_toolbar_location: "top",
                            theme_advanced_toolbar_align: "left",
                            theme_advanced_statusbar_location: "bottom",
                            valid_elements: "@[id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|"
                                     + "onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|"
                                     + "onkeydown|onkeyup],a[rel|rev|charset|hreflang|tabindex|accesskey|type|"
                                     + "name|href|target|title|class|onfocus|onblur],strong/b,em/i,strike,u,"
                                     + "#p,-ol[type|compact],-ul[type|compact],-li,br,img[longdesc|usemap|"
                                     + "src|border|alt=|title|hspace|vspace|width|height|align],-sub,-sup,"
                                     + "-blockquote,-table[border=0|cellspacing|cellpadding|width|frame|rules|"
                                     + "height|align|summary|bgcolor|background|bordercolor],-tr[rowspan|width|"
                                     + "height|align|valign|bgcolor|background|bordercolor],tbody,thead,tfoot,"
                                     + "#td[colspan|rowspan|width|height|align|valign|bgcolor|background|bordercolor"
                                     + "|scope],#th[colspan|rowspan|width|height|align|valign|scope],caption,-div,"
                                     + "-span,-code,-pre,address,-h1,-h2,-h3,-h4,-h5,-h6,hr[size|noshade],-font[face"
                                     + "|size|color],dd,dl,dt,cite,abbr,acronym,del[datetime|cite],ins[datetime|cite],"
                                     + "object[classid|width|height|codebase|*],param[name|value|_value],embed[type|width"
                                     + "|height|src|*],map[name],area[shape|coords|href|alt|target],bdo,"
                                     + "button,col[align|char|charoff|span|valign|width],colgroup[align|char|charoff|span|"
                                     + "valign|width],dfn,fieldset,form[action|accept|accept-charset|enctype|method],"
                                     + "input[accept|alt|checked|disabled|maxlength|name|readonly|size|src|type|value],"
                                     + "kbd,label[for],legend,noscript,optgroup[label|disabled],option[disabled|label|selected|value],"
                                     + "q[cite],samp,select[disabled|multiple|name|size],small,"
                                     + "textarea[cols|rows|disabled|name|readonly],tt,var,big"
                        }); 
                    </script>

                    <p style="text-align: center; margin: 10px 0px;">
                        <%= Html.Hidden("Answer.QuestionID", Model.Question.ID) %>
                        <input type="submit" value="Gửi" onclick="replySubmit();" class="btn_question" />
                        <input type="button" value="Hủy" onclick="cancelSubmit();" class="btn_question" />
                    </p>
                    </form>
                </div>
            </div>
        </div>
        <div class="question">
            <div class="q1">
                <div class="q11">
                    <h3 style="color: White;">
                        Danh sách câu trả lời (<%= Model.Question.nPubAnswers %>)</h3>
                </div>
                <div class="q12">
                    &nbsp;</div>
                <div class="q13">
                    &nbsp;</div>
            </div>
            <div style="width: 582px;">
                <% if (Model.ListAnswer != null && Model.ListAnswer.Count() > 0)
                   {%>
                <ul>
                    <%
                       foreach (var a in Model.ListAnswer)
                       {
                    %>
                    <li class="line_dot">
                        <div style="margin: 10px 0px 20px 0px;">
                            Trả lời bởi: <b>
                                <%= a.AddBy.HasValue? a.aspnet_User.UserName: a.AnswerName %></b>, vào lúc :
                            <%= a.AddDate %></div>
                        <div class="detail">
                            <%= a.Answers %>
                        </div>
                    </li>
                    <%}%>
                </ul>
                <%
                   }%>
            </div>
            <div class="clear"></div>
                <div class="pager">
                    <% if (Model.ListAnswer != null && Model.ListAnswer.Count()>0)
                       { %>
                    <%= Html.Pager(Model.ListAnswer.PageSize, Model.ListAnswer.PageNumber, Model.ListAnswer.TotalItemCount)%>
                    <%} %>
                </div>
        </div>
    </div>
    <div class="tinrao_col_l">
        <div class="bor_cor" style="margin-bottom: 5px;">
            <div class="bar_org_small module-title" align="center">
                <span class="module-title module-title">HỎI - ĐÁP</span>
            </div>
            <form action="/Question/Create" method="post">
            <div class="module_content">
                <div class="new_list" style="text-align: center; cursor: pointer;">
                    <textarea name="questionContent" id="questionContent" cols="20" rows="4"></textarea>
                    <div class="clear">
                    </div>
                </div>
                <div style="margin-bottom: 6px; margin-top: 10px; text-align: center;">
                    <input type="submit" value="Gửi câu hỏi" />
                </div>
            </div>
            </form>
            <div class="clear">
            </div>
        </div>
        <div class="bor_cor" style="margin-bottom: 5px;">
            <% Html.RenderAction("Lasted", "Question", new
               {
                   title = "Hỏi đáp được quan tâm"
               }); %>
        </div>
        <div class="bor_cor" style="margin-bottom: 5px;">
            <% Html.RenderAction("Newsest", "Question", new
               {
                   title = "Hỏi đáp mới nhất"
               }); %>
        </div>
        <div class="bor_cor" style="margin-bottom: 5px;">
            <div class="bar_org_small module-title" align="center">
                <span class="module-title module-title">Chủ đề được quan tâm</span>
            </div>
            <div class="module_content">
                <div class="module_content_chudautu">
                    <ul class="company_chudautu">
                        <li class="company_chudautu">
                            <div class="new_point_img">
                                <a href="#">
                                    <img width="62" height="55" class="bor_img" alt="" src="/Images/image-temp/24-1.jpg">
                                </a>
                            </div>
                            <div class="new_point_txt">
                                <a class="link_gray" href="#">Công ty TSQ Việt Nam</a>
                            </div>
                            <div class="clear">
                            </div>
                        </li>
                        <li class="company_chudautu bg_gray">
                            <div class="new_point_img">
                                <a href="#">
                                    <img width="62" height="55" class="bor_img" alt="" src="/Images/image-temp/87-1.gif">
                                </a>
                            </div>
                            <div class="new_point_txt">
                                <a class="link_gray" href="#">Tổng Công ty Cổ phần Đầu</a>
                            </div>
                            <div class="clear">
                            </div>
                        </li>
                        <li class="company_chudautu">
                            <div class="new_point_img">
                                <a href="#">
                                    <img width="62" height="55" class="bor_img" alt="" src="/Images/image-temp/305-ort.jpg">
                                </a>
                            </div>
                            <div class="new_point_txt">
                                <a class="link_gray" href="#">Keangnam enterprises ltd</a>
                            </div>
                            <div class="clear">
                            </div>
                        </li>
                        <li class="company_chudautu bg_gray">
                            <div class="new_point_img">
                                <a href="#">
                                    <img width="62" height="55" class="bor_img" alt="" src="/Images/image-temp/127-136978-du-an-royal-city-royal-city.jpg">
                                </a>
                            </div>
                            <div class="new_point_txt">
                                <a class="link_gray" href="#">Công ty cổ phần Bất Động Sản AZ</a>
                            </div>
                            <div class="clear">
                            </div>
                        </li>
                        <li class="company_chudautu">
                            <div class="new_point_img">
                                <a href="#">
                                    <img width="62" height="55" class="bor_img" alt="" src="/Images/image-temp/21-THAphoicanh.jpg">
                                </a>
                            </div>
                            <div class="new_point_txt">
                                <a class="link_gray" href="#">Công ty Cổ Phần Tập đoàn Nam Cường, </a>
                            </div>
                            <div class="clear">
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="clear">
                </div>
            </div>
            <div class="clear">
            </div>
        </div>
        <div class="bor_cor" style="margin-bottom: 5px;">
            <div class="bar_org_small module-title" align="center">
                <span class="module-title module-title">Doanh nghiệp tiêu biẻu</span>
            </div>
            <div class="module_content">
                <div class="module_content_chudautu">
                    <ul class="company_chudautu">
                        <li class="company_chudautu">
                            <div class="new_point_img">
                                <a href="#">
                                    <img width="62" height="55" class="bor_img" alt="" src="/Images/image-temp/24-1.jpg">
                                </a>
                            </div>
                            <div class="new_point_txt">
                                <a class="link_gray" href="#">Công ty TSQ Việt Nam</a>
                            </div>
                            <div class="clear">
                            </div>
                        </li>
                        <li class="company_chudautu bg_gray">
                            <div class="new_point_img">
                                <a href="#">
                                    <img width="62" height="55" class="bor_img" alt="" src="/Images/image-temp/87-1.gif">
                                </a>
                            </div>
                            <div class="new_point_txt">
                                <a class="link_gray" href="#">Tổng Công ty Cổ phần Đầu</a>
                            </div>
                            <div class="clear">
                            </div>
                        </li>
                        <li class="company_chudautu">
                            <div class="new_point_img">
                                <a href="#">
                                    <img width="62" height="55" class="bor_img" alt="" src="/Images/image-temp/305-ort.jpg">
                                </a>
                            </div>
                            <div class="new_point_txt">
                                <a class="link_gray" href="#">Keangnam enterprises ltd</a>
                            </div>
                            <div class="clear">
                            </div>
                        </li>
                        <li class="company_chudautu bg_gray">
                            <div class="new_point_img">
                                <a href="#">
                                    <img width="62" height="55" class="bor_img" alt="" src="/Images/image-temp/127-136978-du-an-royal-city-royal-city.jpg">
                                </a>
                            </div>
                            <div class="new_point_txt">
                                <a class="link_gray" href="#">Công ty cổ phần Bất Động Sản AZ</a>
                            </div>
                            <div class="clear">
                            </div>
                        </li>
                        <li class="company_chudautu">
                            <div class="new_point_img">
                                <a href="#">
                                    <img width="62" height="55" class="bor_img" alt="" src="/Images/image-temp/21-THAphoicanh.jpg">
                                </a>
                            </div>
                            <div class="new_point_txt">
                                <a class="link_gray" href="#">Công ty Cổ Phần Tập đoàn Nam Cường, </a>
                            </div>
                            <div class="clear">
                            </div>
                        </li>
                    </ul>
                </div>
                <div class="clear">
                </div>
            </div>
            <div class="clear">
            </div>
        </div>
    </div>
    <div class="clear">
    </div>
</asp:Content>
